$inputseq = $ARGV[0];
chomp($inputseq);
$inputdatabase = $ARGV[1];
chomp($inputdatabase);
$output = $ARGV[2];
chomp($output);
open BUFF,"<$inputseq" or die "can't open $inputseq";
open BUFF1,"<$inputdatabase" or die "can't open $inputdatabase";
$line = <BUFF>;
chomp($line);
#print $line."\n";
@array = split(" ",$line);
$primerstart = $array[0];
$primerend = $array[@array-1];
shift(@array);
pop(@array);
$seqline = join("",@array);
@array1 = split("__",$seqline);
$linkerstart = $array1[0];
$linkerend = $array1[1];
#print $linkerstart."\t".$linkerend."\n";
$database = "";
while($line = <BUFF1>)
{
	chomp($line);
	$database = $database."$line";
}
#print $database."\n";

$database =~ s/$linkerstart/ /g;
$database =~ s/$linkerend/ /g;
@array2 = split(" ",$database);
if(@array2 == 3)
{
	print $linkerstart."\n".$array2[1]."\n".$linkerend."\n";
}


